package DAO;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import table.Student_KT_View;
import util.BaseConnection;

public class Student_KT_View_DAO {
	public Student_KT_View getValue(String sno) {
		Student_KT_View skv = new Student_KT_View();
		Connection conn = BaseConnection.getConnection();
		PreparedStatement ps = null;
		ResultSet rs = null;
		String sql = "select * from Student_KT_View where Student_id = ?";
		try {
			ps = conn.prepareStatement(sql);
			ps.setString(1, sno);
			rs = ps.executeQuery();
			while (rs.next()) {
				skv.setStudent_id(rs.getString("student_id"));
				skv.setKT_id(rs.getString("kT_id"));
				skv.setKT_name(rs.getString("KT_name"));
				skv.setKT_content(rs.getString("KT_content"));
				skv.setTeacher_name(rs.getString("Teacher_name"));
				skv.setStudent_KT_grade(rs.getString("Student_KT_grade"));
			}
			
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return skv;
	}
}
